package com.zsy.mapper;

import com.zsy.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    //用户名查询用户
    @Select("select * from user where username=#{username}")
    User findByUserName(String username);

    @Insert("insert into user(username,password,email) values (#{username},#{password},#{email})")
    void add(String username, String password, String email);

    @Select("UPDATE user SET password = #{newPwd} WHERE username = #{username}")
    void userPwdService(String newPwd,String username);
}
